package com.ss.android.article.browser.database.bookmark;

import android.database.Cursor;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import com.a.a.NightMode;
import com.a.a.u;
import com.ss.android.article.browser.R;
import com.ss.android.article.browser.database.BrowserHistory;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

final class f implements NightMode {
    private final a a;

    f(a arg1) {
        this.a = arg1;

    }

    public final void f(@NonNull Object arg11) {
        Cursor v0 = a.a(this.a).query(true, "bookmark", new String[]{"folder"}, null, null, null, null, null, null);
        ArrayList v2 = new ArrayList();
        while(v0.moveToNext()) {
            String v3 = v0.getString(v0.getColumnIndex("folder"));
            if(TextUtils.isEmpty(((CharSequence)v3))) {
                continue;
            }

            BrowserHistory v4 = new BrowserHistory();
            v4.h = true;
            v4.setTitle(v3);
            v4.icon = R.drawable.ff;
            v4.setUrl("folder://" + v3);
            ((List)v2).add(v4);
        }

        v0.close();
        Collections.sort(((List)v2));
        ((u)arg11).onItem(v2);
        ((u)arg11).onComplete();
    }
}

